package net;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.Socket;

public class TestTcpClient {

	public static void main(String[] args) throws Exception{
		Socket socket=new Socket("127.0.0.1", 9000);
		BufferedReader reader=new BufferedReader(new InputStreamReader(socket.getInputStream(), "UTF-8"));
		OutputStream out=socket.getOutputStream();
		String line=reader.readLine();
		System.out.println(line+".......");
		out.write("Hello I am John!!!\n".getBytes());
		
		reader.close();
		out.close();
		socket.close();
	}

}
